import request from '@/utils/request'

export function sendCode(data) {
    return request({
        url: '/api/register/verify',
        data,
        method: 'POST',
    })
}

export async function login(data) {
    const deviceInfo = await uni.getDeviceInfo()
    return request({
        url: '/api/login',
        data: {
            ...data,
            deviceId: deviceInfo.deviceId,
        },
        method: 'POST',
    })
}

export function register(data) {
    return request({
        url: '/api/register',
        data,
        method: 'POST',
    })
}
